// Copyright (C) Moondance Labs Ltd.
// This file is part of Tanssi.

// Tanssi is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Tanssi is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Tanssi.  If not, see <http://www.gnu.org/licenses/>


//! Autogenerated weights for pallet_author_noting
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 43.0.0
//! DATE: 2024-12-31, STEPS: `16`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `tomasz-XPS-15-9520`, CPU: `12th Gen Intel(R) Core(TM) i7-12700H`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024

// Executed Command:
// ./target/release/tanssi-node
// benchmark
// pallet
// --execution=wasm
// --wasm-execution=compiled
// --pallet
// pallet_author_noting
// --extrinsic
// *
// --chain=dev
// --steps
// 16
// --repeat
// 1
// --template=benchmarking/frame-weight-pallet-template.hbs
// --json-file
// raw.json
// --output
// tmp/pallet_author_noting.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use sp_std::marker::PhantomData;

/// Weight functions needed for pallet_author_noting.
pub trait WeightInfo {
	fn set_latest_author_data(x: u32, ) -> Weight;
	fn set_author() -> Weight;
	fn kill_author_data() -> Weight;
	fn on_container_authors_noted(x: u32, ) -> Weight;
}

/// Weights for pallet_author_noting using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
	/// Storage: `AuthorNoting::DidSetContainerAuthorData` (r:1 w:1)
	/// Proof: `AuthorNoting::DidSetContainerAuthorData` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
	/// Storage: `Registrar::RegisteredParaIds` (r:1 w:0)
	/// Proof: `Registrar::RegisteredParaIds` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
	/// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
	/// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	/// Storage: `System::Digest` (r:1 w:0)
	/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	/// Storage: `CollatorAssignment::CollatorContainerChain` (r:1 w:0)
	/// Proof: `CollatorAssignment::CollatorContainerChain` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	/// Storage: `AuthorNoting::LatestAuthor` (r:100 w:100)
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
	/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
	/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(418), added: 913, mode: `MaxEncodedLen`)
	/// The range of component `x` is `[1, 100]`.
	fn set_latest_author_data(x: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `493 + x * (73 ±0)`
		//  Estimated: `1978 + x * (2539 ±0)`
		// Minimum execution time: 48_373_000 picoseconds.
		Weight::from_parts(48_373_000, 1978)
			// Standard Error: 633_051
			.saturating_add(Weight::from_parts(15_379_156, 0).saturating_mul(x.into()))
			.saturating_add(T::DbWeight::get().reads(6_u64))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into())))
			.saturating_add(T::DbWeight::get().writes(2_u64))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x.into())))
			.saturating_add(Weight::from_parts(0, 2539).saturating_mul(x.into()))
	}
	/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
	fn set_author() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `0`
		//  Estimated: `0`
		// Minimum execution time: 9_241_000 picoseconds.
		Weight::from_parts(9_241_000, 0)
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
	/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
	fn kill_author_data() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `0`
		//  Estimated: `0`
		// Minimum execution time: 11_313_000 picoseconds.
		Weight::from_parts(11_313_000, 0)
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
	/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
	/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(418), added: 913, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:4 w:3)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
	/// Storage: `PooledStaking::Pools` (r:2 w:0)
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:1 w:0)
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
	/// Storage: `XcmCoreBuyer::PendingBlocks` (r:0 w:1)
	/// Proof: `XcmCoreBuyer::PendingBlocks` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	/// The range of component `x` is `[1, 50]`.
	fn on_container_authors_noted(x: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `881`
		//  Estimated: `11402`
		// Minimum execution time: 92_161_000 picoseconds.
		Weight::from_parts(76_221_073, 11402)
			// Standard Error: 239_851
			.saturating_add(Weight::from_parts(10_452_583, 0).saturating_mul(x.into()))
			.saturating_add(T::DbWeight::get().reads(9_u64))
			.saturating_add(T::DbWeight::get().writes(5_u64))
	}
}

// For backwards compatibility and tests
impl WeightInfo for () {
	/// Storage: `AuthorNoting::DidSetContainerAuthorData` (r:1 w:1)
	/// Proof: `AuthorNoting::DidSetContainerAuthorData` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
	/// Storage: `Registrar::RegisteredParaIds` (r:1 w:0)
	/// Proof: `Registrar::RegisteredParaIds` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
	/// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
	/// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	/// Storage: `System::Digest` (r:1 w:0)
	/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	/// Storage: `CollatorAssignment::CollatorContainerChain` (r:1 w:0)
	/// Proof: `CollatorAssignment::CollatorContainerChain` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	/// Storage: `AuthorNoting::LatestAuthor` (r:100 w:100)
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
	/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
	/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(418), added: 913, mode: `MaxEncodedLen`)
	/// The range of component `x` is `[1, 100]`.
	fn set_latest_author_data(x: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `493 + x * (73 ±0)`
		//  Estimated: `1978 + x * (2539 ±0)`
		// Minimum execution time: 48_373_000 picoseconds.
		Weight::from_parts(48_373_000, 1978)
			// Standard Error: 633_051
			.saturating_add(Weight::from_parts(15_379_156, 0).saturating_mul(x.into()))
			.saturating_add(RocksDbWeight::get().reads(6_u64))
			.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(x.into())))
			.saturating_add(RocksDbWeight::get().writes(2_u64))
			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(x.into())))
			.saturating_add(Weight::from_parts(0, 2539).saturating_mul(x.into()))
	}
	/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
	fn set_author() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `0`
		//  Estimated: `0`
		// Minimum execution time: 9_241_000 picoseconds.
		Weight::from_parts(9_241_000, 0)
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
	/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
	fn kill_author_data() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `0`
		//  Estimated: `0`
		// Minimum execution time: 11_313_000 picoseconds.
		Weight::from_parts(11_313_000, 0)
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
	/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
	/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(418), added: 913, mode: `MaxEncodedLen`)
	/// Storage: `System::Account` (r:4 w:3)
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
	/// Storage: `PooledStaking::Pools` (r:2 w:0)
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:1 w:0)
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
	/// Storage: `XcmCoreBuyer::PendingBlocks` (r:0 w:1)
	/// Proof: `XcmCoreBuyer::PendingBlocks` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
	/// The range of component `x` is `[1, 50]`.
	fn on_container_authors_noted(x: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `881`
		//  Estimated: `11402`
		// Minimum execution time: 92_161_000 picoseconds.
		Weight::from_parts(76_221_073, 11402)
			// Standard Error: 239_851
			.saturating_add(Weight::from_parts(10_452_583, 0).saturating_mul(x.into()))
			.saturating_add(RocksDbWeight::get().reads(9_u64))
			.saturating_add(RocksDbWeight::get().writes(5_u64))
	}
}
